﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Cloud.DataStore.Models
{
    /// <summary>
    /// 表的字段定义
    /// </summary>
    public partial class Property
    {
        // <summary>
        /// 属性对应的类型
        /// </summary>
        public override Type Type
        {
            get 
            {
                switch (this.FieldType)
                {
                    case PropertyType.Bool:
                        return typeof(System.Boolean);
                    case PropertyType.DateTime:
                        return typeof(System.DateTime);
                    case PropertyType.Double:
                        return typeof(System.Double);
                    case PropertyType.Int:
                        return typeof(System.Int32);
                    case PropertyType.Int16:
                        return typeof(System.Int16);
                    case PropertyType.Int32:
                        return typeof(System.Int32);
                    case PropertyType.Int64:
                        return typeof(System.Int64);
                    case PropertyType.Float:
                        return typeof(float);
                    case PropertyType.String:
                    case PropertyType.ByteArray://TODO
                        return typeof(System.String);
                    default:
                        return typeof(System.Object);
                }
            }
        }
    }
}
